package com.fuhaiwei.domain.model;

public class User extends BasePO {
	private int id;
	private String username;
	private String password;

	public User() {
	}

	public User(String username, String password) {
		setUsername(username);
		setPassword(password);
	}

	public User(int id, String username, String password) {
		setId(id);
		setUsername(username);
		setPassword(password);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String toString() {
		return "<id=" + id + ", username=" + username + ", password="
				+ password + ">";
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj instanceof User) {
			User user2 = (User) obj;
			if (getUsername() == null && user2.getUsername() == null) {
				return true;
			} else if (getUsername() == null || user2.getUsername() == null) {
				return false;
			} else {
				return getUsername().equals(user2.getUsername());
			}
		} else {
			return false;
		}
	}

	public int hashCode() {
		if (username == null) {
			return 0;
		}
		return username.hashCode();
	}

	public Object clone() {
		User user = (User) super.clone();
		return user;
	}

}
